{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d68d6a44",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://sh.lianjia.com/ershoufang/pg1rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.06秒\n",
      "https://sh.lianjia.com/ershoufang/pg2rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.47秒\n",
      "https://sh.lianjia.com/ershoufang/pg3rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.82秒\n",
      "https://sh.lianjia.com/ershoufang/pg4rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.95秒\n",
      "https://sh.lianjia.com/ershoufang/pg5rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.45秒\n",
      "https://sh.lianjia.com/ershoufang/pg6rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.52秒\n",
      "https://sh.lianjia.com/ershoufang/pg7rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.59秒\n",
      "https://sh.lianjia.com/ershoufang/pg8rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.91秒\n",
      "https://sh.lianjia.com/ershoufang/pg9rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.91秒\n",
      "https://sh.lianjia.com/ershoufang/pg10rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.41秒\n",
      "https://sh.lianjia.com/ershoufang/pg11rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.94秒\n",
      "https://sh.lianjia.com/ershoufang/pg12rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.17秒\n",
      "https://sh.lianjia.com/ershoufang/pg13rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.93秒\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import re\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "import pandas as pd\n",
    "import random\n",
    "import time\n",
    "from fake_useragent import UserAgent\n",
    "\n",
    "ua = UserAgent()\n",
    "\n",
    "Res = []\n",
    "for page in range(1,14):\n",
    "    url = 'https://sh.lianjia.com/ershoufang/pg{}rs%E7%94%B0%E6%9E%97'.format(page)\n",
    "    print(url)\n",
    "    WZ = ua.random\n",
    "    response = requests.get(url, headers = {'User-Agent':WZ})\n",
    "    soup = BeautifulSoup(response.text, 'html.parser')\n",
    "    \n",
    "    try:\n",
    "        houseinfo = {}\n",
    "        houseinfo['name'] = [i.text.split('-')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'positionInfo'})]\n",
    "        houseinfo['roomtype'] = [i.text.split('|')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['size'] = [float(i.text.split('|')[1].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['direction'] = [i.text.split('|')[2].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['style'] = [i.text.split('|')[3].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['floow'] = [i.text.split('|')[4].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['builtdate'] = [float(i.text.split('|')[5].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['building'] = [i.text.split('|')[6].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['totamt']= [float(i.text[:-1]) for i in soup.findAll(name='div', attrs = {'class':'totalPrice totalPrice2'})]\n",
    "        houseinfo['price'] = [int(i.text[0:-3].replace(',','') )for i in soup.findAll(name='div', attrs = {'class':'unitPrice'})]\n",
    "    except Exception as e:\n",
    "        print(e)\n",
    "    Res.append(pd.DataFrame.from_dict(houseinfo))\n",
    "    \n",
    "    seconds = random.uniform(2,4)\n",
    "    time.sleep(seconds)\n",
    "    print(\"网页停留时长{}秒\".format(round(seconds,2)))\n",
    "    \n",
    "pd.concat(Res).to_excel('田林新二手房.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "34f9dd96",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://sh.lianjia.com/ershoufang/pg1rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.29秒\n",
      "https://sh.lianjia.com/ershoufang/pg2rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.77秒\n",
      "https://sh.lianjia.com/ershoufang/pg3rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.37秒\n",
      "https://sh.lianjia.com/ershoufang/pg4rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.51秒\n",
      "https://sh.lianjia.com/ershoufang/pg5rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.11秒\n",
      "https://sh.lianjia.com/ershoufang/pg6rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.21秒\n",
      "https://sh.lianjia.com/ershoufang/pg7rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.16秒\n",
      "https://sh.lianjia.com/ershoufang/pg8rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.23秒\n",
      "https://sh.lianjia.com/ershoufang/pg9rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.89秒\n",
      "https://sh.lianjia.com/ershoufang/pg10rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.33秒\n",
      "https://sh.lianjia.com/ershoufang/pg11rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长2.85秒\n",
      "https://sh.lianjia.com/ershoufang/pg12rs%E7%94%B0%E6%9E%97\n",
      "网页停留时长3.11秒\n"
     ]
    }
   ],
   "source": [
    "#修正空格错误\n",
    "import requests\n",
    "import re\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "import pandas as pd\n",
    "import random\n",
    "import time\n",
    "from fake_useragent import UserAgent\n",
    "\n",
    "ua = UserAgent()\n",
    "\n",
    "Res = []\n",
    "for page in range(1,13):\n",
    "    url = 'https://sh.lianjia.com/ershoufang/pg{}rs%E7%94%B0%E6%9E%97'.format(page)\n",
    "    print(url)\n",
    "    WZ = ua.random\n",
    "    response = requests.get(url, headers = {'User-Agent':WZ})\n",
    "    soup = BeautifulSoup(response.text, 'html.parser')\n",
    "    \n",
    "    try:\n",
    "        houseinfo = {}\n",
    "        houseinfo['name'] = [i.text.split('-')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'positionInfo'})]\n",
    "        houseinfo['roomtype'] = [i.text.split('|')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['size'] = [float(i.text.split('|')[1].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['direction'] = [i.text.split('|')[2].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['style'] = [i.text.split('|')[3].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['floow'] = [i.text.split('|')[4].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['builtdate'] = [i.text.split('|')[5].strip()[:-2] for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})] \n",
    "        houseinfo['building'] = [i.text.split('|')[-1].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['totamt']= [float(i.text[:-1]) for i in soup.findAll(name='div', attrs = {'class':'totalPrice totalPrice2'})]\n",
    "        houseinfo['price'] = [int(i.text[0:-3].replace(',','') )for i in soup.findAll(name='div', attrs = {'class':'unitPrice'})]\n",
    "    except Exception as e:\n",
    "        print(e)\n",
    "    Res.append(pd.DataFrame.from_dict(houseinfo))\n",
    "    \n",
    "    seconds = random.uniform(2,4)\n",
    "    time.sleep(seconds)\n",
    "    print(\"网页停留时长{}秒\".format(round(seconds,2)))\n",
    "    \n",
    "pd.concat(Res).to_excel('田林新二手房_修正.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "52ef20ca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://sh.lianjia.com/ershoufang/pg5rs%E7%94%B0%E6%9E%97\n"
     ]
    },
    {
     "ename": "TypeError",
     "evalue": "'NoneType' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[9], line 14\u001b[0m\n\u001b[0;32m     11\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m     12\u001b[0m     \u001b[38;5;28mprint\u001b[39m(e)\n\u001b[1;32m---> 14\u001b[0m \u001b[38;5;28mprint\u001b[39m(soup\u001b[38;5;241m.\u001b[39mfind(name\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdiv\u001b[39m\u001b[38;5;124m'\u001b[39m, attrs \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mclass\u001b[39m\u001b[38;5;124m'\u001b[39m:\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mhouseInfo\u001b[39m\u001b[38;5;124m'\u001b[39m})\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m|\u001b[39m\u001b[38;5;124m'\u001b[39m)[\u001b[38;5;241m5\u001b[39m]\u001b[38;5;241m.\u001b[39mreplace(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mNoneType\u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;241m0\u001b[39m))\n\u001b[0;32m     15\u001b[0m houseinfo\n",
      "\u001b[1;31mTypeError\u001b[0m: 'NoneType' object is not callable"
     ]
    }
   ],
   "source": [
    "#问题测试\n",
    "for page in range(5,6):\n",
    "    url = 'https://sh.lianjia.com/ershoufang/pg{}rs%E7%94%B0%E6%9E%97'.format(page)\n",
    "    print(url)\n",
    "    WZ = ua.random\n",
    "    response = requests.get(url, headers = {'User-Agent':WZ})\n",
    "    soup = BeautifulSoup(response.text, 'html.parser')\n",
    "    try:\n",
    "        houseinfo = {}\n",
    "        houseinfo['builtdate'] = [float(i.text.split('|')[5].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})] \n",
    "    except Exception as e:\n",
    "        print(e)\n",
    "    \n",
    "    print(soup.find(name='div', attrs = {'class':'houseInfo'}).split('|')[5].replace('NoneType',0))\n",
    "    houseinfo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "b697b45d",
   "metadata": {},
   "outputs": [],
   "source": [
    "url = 'https://sh.lianjia.com/ditiefang/li50000012336968s5020055969208535/rs%E5%90%B4%E4%B8%AD%E8%B7%AF/'\n",
    "response = requests.get(url)\n",
    "soup = BeautifulSoup(response.text, 'html.parser')\n",
    "houseinfo['builtdate'] = []\n",
    "houseinfo['building'] = []\n",
    "for objects in soup.findAll(name='div', attrs = {'class':'houseInfo'}):\n",
    "        if objects.text.split('|')[5].strip()[:-2] == '':\n",
    "            houseinfo['builtdate'].append(None)\n",
    "            houseinfo['building'].append(objects.text.split('|')[5].strip())   \n",
    "        else:\n",
    "            houseinfo['builtdate'].append(float(objects.text.split('|')[5].strip()[:-2]))\n",
    "            houseinfo['building'].append(objects.text.split('|')[6].strip())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "b8c12fc3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://sh.lianjia.com/ditiefang/li50000012336968s5020055969208535/rs%E5%90%B4%E4%B8%AD%E8%B7%AF\n",
      "网页停留时长2.6秒\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import random\n",
    "import time\n",
    "from fake_useragent import UserAgent\n",
    "\n",
    "ua = UserAgent()\n",
    "\n",
    "Res = []\n",
    "page = 1\n",
    "url = 'https://sh.lianjia.com/ditiefang/li50000012336968s5020055969208535/rs%E5%90%B4%E4%B8%AD%E8%B7%AF'.format(page)\n",
    "print(url)\n",
    "WZ = ua.random\n",
    "response = requests.get(url, headers = {'User-Agent':WZ})\n",
    "soup = BeautifulSoup(response.text, 'html.parser')\n",
    "    \n",
    "try:\n",
    "    houseinfo = {}\n",
    "    houseinfo['name'] = [i.text.split('-')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'positionInfo'})]\n",
    "    houseinfo['roomtype'] = [i.text.split('|')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['size'] = [float(i.text.split('|')[1].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['direction'] = [i.text.split('|')[2].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['style'] = [i.text.split('|')[3].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['floow'] = [i.text.split('|')[4].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['builtdate'] = []\n",
    "    houseinfo['building'] = []\n",
    "    for objects in soup.findAll(name='div', attrs = {'class':'houseInfo'}):\n",
    "        if objects.text.split('|')[5].strip()[:-2] == '':\n",
    "            houseinfo['builtdate'].append(None)\n",
    "            houseinfo['building'].append(objects.text.split('|')[5].strip())   \n",
    "        else:\n",
    "            houseinfo['builtdate'].append(float(objects.text.split('|')[5].strip()[:-2]))\n",
    "            houseinfo['building'].append(objects.text.split('|')[6].strip())\n",
    "    houseinfo['totamt']= [float(i.text[:-1]) for i in soup.findAll(name='div', attrs = {'class':'totalPrice totalPrice2'})]\n",
    "    houseinfo['price'] = [int(i.text[0:-3].replace(',','') )for i in soup.findAll(name='div', attrs = {'class':'unitPrice'})]\n",
    "except Exception as e:\n",
    "    print(e)\n",
    "Res.append(pd.DataFrame.from_dict(houseinfo))\n",
    "    \n",
    "seconds = random.uniform(2,4)\n",
    "time.sleep(seconds)\n",
    "print(\"网页停留时长{}秒\".format(round(seconds,2)))\n",
    "    \n",
    "pd.concat(Res).to_excel('吴中路新二手房.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "c8317ad3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://sh.lianjia.com/ditiefang/li50000012336968s5020055969208535/rs%E5%90%B4%E4%B8%AD%E8%B7%AF\n",
      "could not convert string to float: ''\n",
      "网页停留时长3.85秒\n",
      "https://sh.lianjia.com/ditiefang/li50000012336968s5020055969208535/rs%E5%90%B4%E4%B8%AD%E8%B7%AF\n",
      "could not convert string to float: ''\n",
      "网页停留时长3.88秒\n",
      "https://sh.lianjia.com/ditiefang/li50000012336968s5020055969208535/rs%E5%90%B4%E4%B8%AD%E8%B7%AF\n",
      "could not convert string to float: ''\n",
      "网页停留时长3.38秒\n"
     ]
    }
   ],
   "source": [
    "# 吴中路2023.9数据累计成多页\n",
    "import pandas as pd\n",
    "import random\n",
    "import time\n",
    "from fake_useragent import UserAgent\n",
    "\n",
    "ua = UserAgent()\n",
    "\n",
    "Res = []\n",
    "for page in range(1,4):\n",
    "    url = 'https://sh.lianjia.com/ditiefang/li50000012336968s5020055969208535/rs%E5%90%B4%E4%B8%AD%E8%B7%AF'.format(page)\n",
    "    print(url)\n",
    "    WZ = ua.random\n",
    "    response = requests.get(url, headers = {'User-Agent':WZ})\n",
    "    soup = BeautifulSoup(response.text, 'html.parser')\n",
    "    \n",
    "    try:\n",
    "        houseinfo = {}\n",
    "        houseinfo['name'] = [i.text.split('-')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'positionInfo'})]\n",
    "        houseinfo['roomtype'] = [i.text.split('|')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['size'] = [float(i.text.split('|')[1].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['direction'] = [i.text.split('|')[2].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['style'] = [i.text.split('|')[3].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['floow'] = [i.text.split('|')[4].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['builtdate'] = [float(i.text.split('|')[5].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['building'] = [i.text.split('|')[6].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "        houseinfo['totamt']= [float(i.text[:-1]) for i in soup.findAll(name='div', attrs = {'class':'totalPrice totalPrice2'})]\n",
    "        houseinfo['price'] = [int(i.text[0:-3].replace(',','') )for i in soup.findAll(name='div', attrs = {'class':'unitPrice'})]\n",
    "    except Exception as e:\n",
    "        print(e)\n",
    "    Res.append(pd.DataFrame.from_dict(houseinfo))\n",
    "    \n",
    "    seconds = random.uniform(2,4)\n",
    "    time.sleep(seconds)\n",
    "    print(\"网页停留时长{}秒\".format(round(seconds,2)))\n",
    "    \n",
    "pd.concat(Res).to_excel('吴中路新二手房.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "95335e54",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://sh.lianjia.com/ershoufang/rs%E5%AE%8B%E5%9B%AD%E8%B7%AF/\n",
      "网页停留时长2.6秒\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import random\n",
    "import time\n",
    "from fake_useragent import UserAgent\n",
    "\n",
    "ua = UserAgent()\n",
    "\n",
    "Res = []\n",
    "page = 1\n",
    "url = 'https://sh.lianjia.com/ershoufang/rs%E5%AE%8B%E5%9B%AD%E8%B7%AF/'.format(page)\n",
    "print(url)\n",
    "WZ = ua.random\n",
    "response = requests.get(url, headers = {'User-Agent':WZ})\n",
    "soup = BeautifulSoup(response.text, 'html.parser')\n",
    "    \n",
    "try:\n",
    "    houseinfo = {}\n",
    "    houseinfo['name'] = [i.text.split('-')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'positionInfo'})]\n",
    "    houseinfo['roomtype'] = [i.text.split('|')[0].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['size'] = [float(i.text.split('|')[1].strip()[:-2]) for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['direction'] = [i.text.split('|')[2].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['style'] = [i.text.split('|')[3].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['floow'] = [i.text.split('|')[4].strip() for i in soup.findAll(name='div', attrs = {'class':'houseInfo'})]\n",
    "    houseinfo['builtdate'] = []\n",
    "    houseinfo['building'] = []\n",
    "    for objects in soup.findAll(name='div', attrs = {'class':'houseInfo'}):\n",
    "        if objects.text.split('|')[5].strip()[:-2] == '':\n",
    "            houseinfo['builtdate'].append(None)\n",
    "            houseinfo['building'].append(objects.text.split('|')[5].strip())   \n",
    "        else:\n",
    "            houseinfo['builtdate'].append(float(objects.text.split('|')[5].strip()[:-2]))\n",
    "            houseinfo['building'].append(objects.text.split('|')[6].strip())\n",
    "    houseinfo['totamt']= [float(i.text[:-1]) for i in soup.findAll(name='div', attrs = {'class':'totalPrice totalPrice2'})]\n",
    "    houseinfo['price'] = [int(i.text[0:-3].replace(',','') )for i in soup.findAll(name='div', attrs = {'class':'unitPrice'})]\n",
    "except Exception as e:\n",
    "    print(e)\n",
    "Res.append(pd.DataFrame.from_dict(houseinfo))\n",
    "    \n",
    "seconds = random.uniform(2,4)\n",
    "time.sleep(seconds)\n",
    "print(\"网页停留时长{}秒\".format(round(seconds,2)))\n",
    "    \n",
    "pd.concat(Res).to_excel('宋园路新二手房.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "79874fe3",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
